﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" 
CodeBehind="Cursos.aspx.cs" Inherits="RepositorioDeMonografia.Cursos" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
               
        <fieldset class="CadastraCurso">
                    <legend>Persquisar Curso</legend>
                           
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                        AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                        DataKeyNames="Id" DataSourceID="SqlDataSourceCurso" ForeColor="#333333" 
                        GridLines="None">
                        
                        <Columns>
                            <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" 
                                ReadOnly="True" SortExpression="Id" />
                            <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
                        </Columns>
                       
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSourceCurso" runat="server" 
                        ConflictDetection="CompareAllValues" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        DeleteCommand="DELETE FROM [Curso] WHERE [Id] = @original_Id AND (([Nome] = @original_Nome) OR ([Nome] IS NULL AND @original_Nome IS NULL))" 
                        InsertCommand="INSERT INTO [Curso] ([Nome]) VALUES (@Nome)" 
                        OldValuesParameterFormatString="original_{0}" 
                        SelectCommand="SELECT [Id], [Nome] FROM [Curso]" 
                        UpdateCommand="UPDATE [Curso] SET [Nome] = @Nome WHERE [Id] = @original_Id AND (([Nome] = @original_Nome) OR ([Nome] IS NULL AND @original_Nome IS NULL))">
                        <DeleteParameters>
                            <asp:Parameter Name="original_Id" Type="Int32" />
                            <asp:Parameter Name="original_Nome" Type="String" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="Nome" Type="String" />
                        </InsertParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="Nome" Type="String" />
                            <asp:Parameter Name="original_Id" Type="Int32" />
                            <asp:Parameter Name="original_Nome" Type="String" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
                           
                </fieldset></asp:Content>
